/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Thiago
 */
@Entity
@Table(name = "formapgto", catalog = "trust", schema = "")
/*
@NamedQueries({
    @NamedQuery(name = "Formapgto.findAll", query = "SELECT f FROM Formapgto f"),
    @NamedQuery(name = "Formapgto.findByIdformaPgto", query = "SELECT f FROM Formapgto f WHERE f.idformaPgto = :idformaPgto"),
    @NamedQuery(name = "Formapgto.findByDescricaoPgto", query = "SELECT f FROM Formapgto f WHERE f.descricaoPgto = :descricaoPgto")})
*/

public class Formapgto implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idformaPgto")
    private Integer idformaPgto;
    @Basic(optional = false)
    @Column(name = "descricaoPgto")
    private String descricaoPgto;

    public Formapgto() {
    }

    public Formapgto(Integer idformaPgto) {
        this.idformaPgto = idformaPgto;
    }

    public Formapgto(Integer idformaPgto, String descricaoPgto) {
        this.idformaPgto = idformaPgto;
        this.descricaoPgto = descricaoPgto;
    }

    public Integer getIdformaPgto() {
        return idformaPgto;
    }

    public void setIdformaPgto(Integer idformaPgto) {
        Integer oldIdformaPgto = this.idformaPgto;
        this.idformaPgto = idformaPgto;
        changeSupport.firePropertyChange("idformaPgto", oldIdformaPgto, idformaPgto);
    }

    public String getDescricaoPgto() {
        return descricaoPgto;
    }

    public void setDescricaoPgto(String descricaoPgto) {
        String oldDescricaoPgto = this.descricaoPgto;
        this.descricaoPgto = descricaoPgto;
        changeSupport.firePropertyChange("descricaoPgto", oldDescricaoPgto, descricaoPgto);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idformaPgto != null ? idformaPgto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Formapgto)) {
            return false;
        }
        Formapgto other = (Formapgto) object;
        if ((this.idformaPgto == null && other.idformaPgto != null) || (this.idformaPgto != null && !this.idformaPgto.equals(other.idformaPgto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "View.Formapgto_1[ idformaPgto=" + idformaPgto + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
